3to4: Remove GtkToolbar::toolbar_style
authorMatthias Clasen <mclasen@redhat.com>
Tue, 5 Jan 2021 18:57:47 +0000 (13:57 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 Jan 2021 18:58:58 +0000 (13:58 -0500)
The property was removed (with the rest of the widget),
so keeping it around in the ui file makes no sense.

Testcase included.

gtk/tools/gtk-builder-tool-simplify.c
testsuite/tools/simplify-data-3to4/toolbar.ui

index 0541207a97952791c83b2f180d104658910a6a66..b61487c53774e3a1ae25535dea78b1c7e433939e 100644 (file)
@@ -1723,6 +1723,20 @@ rewrite_toolbar (Element      *element,
 
   set_attribute_value (element, "class", "GtkBox");
 
+  for (l = element->children; l; l = l->next)
+    {
+      Element *child = l->data;
+
+      if (g_str_equal (child->element_name, "property") &&
+          (has_attribute (child, "name", "toolbar_style") ||
+           has_attribute (child, "name", "toolbar-style")))
+        {
+          element->children = g_list_remove (element->children, child);
+          free_element (child);
+          break;
+        }
+    }
+
   for (l = element->children; l; l = l->next)
     {
       Element *child = l->data;
index 3f45466024ab1618bf7ad887e7d17f43f7598608..d695a41b6b01d46d4c260d8ceded80f911e743aa 100644 (file)
@@ -3,6 +3,7 @@
   <requires lib="gtk+" version="3.0"/>
   <object class="GtkToolbar">
     <property name="visible">1</property>
+    <property name="toolbar_style">both</property>
     <child>
       <object class="GtkToolButton">
         <property name="visible">1</property>